<?php
namespace app\admin\controller\example;
use app\admin\controller\Backend;

use Flc\Dysms\Client;
use Flc\Dysms\Request\SendSms;

class Dysms extends Backend
{
	public function _initialize() {
		parent::_initialize();
	}

	public function send() {
		/* 构造短信参数 */
		$sendSms = new SendSms;
		// $sendSms->setPhoneNumbers('13896536509,17723153173,13658462226,17723549873,13883562572')
		$sendSms->setPhoneNumbers('00')
		            ->setSignName('悦现场')
		            ->setTemplateCode('SMS_101550010')
		            ->setTemplateParam([
		                'code' => rand(100000, 999999),
		            ]);
		/* 构造执行参数 */
		$client  = new Client(config('service.dysms'));
		$result = $client->execute($sendSms);
		dump($result);
	}
}